package com.small.db;

import android.content.Context;
import android.database.Cursor;

public class DbTool {

	private DbHelper dbHelper = null;

	public DbTool(Context context) {
		dbHelper = new DbHelper(context);		 
		dbHelper.openDataBase();
	}

	public void close() {
		if (dbHelper.getDb() != null)
			dbHelper.getDb().close();
			dbHelper.close(); 
		
	} 
	public void insertParentShopType(int PCategoryID,String PCategoryName,String PLetter){
		  dbHelper.insertParentShopInfo(PCategoryID, PCategoryName, PLetter);
	}
	public void insertChildShopType(int PCategoryID,String PCategoryName,String PLetter,int CategoryID,String CategoryName,String Letter){
		  dbHelper.insertChildShopInfo(PCategoryID, PCategoryName, PLetter, CategoryID, CategoryName, Letter);
	}
	public void insertParentSQ(int PCategoryID,String PCategoryName,String PLetter){
		  dbHelper.insertParentSQInfo(PCategoryID, PCategoryName, PLetter);
	}
	public void insertChildSQ(int PCategoryID,String PCategoryName,String PLetter,int CategoryID,String CategoryName,String Letter){
		  dbHelper.insertChildSQInfo(PCategoryID, PCategoryName, PLetter, CategoryID, CategoryName, Letter);
	}
	public Cursor getChildSQ(int id){
		return  dbHelper.getChildSQInfo(id);
	}
	public Cursor getParentSQ(){
		return  dbHelper.getParentSQInfo();
	}
	public Cursor getChildShop(int id){
		return  dbHelper.getChildShopInfo(id);
	}
	public Cursor getParentShop(){
		return  dbHelper.getParentShopInfo();
	}
}
